;; $Id: oaxaca.scm 498 2014-05-07 18:21:17Z alan.watson.f $

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(unless (and (finder-initialized?) (finder-idle?))
  (log-info "waiting for finder.")
  (finder-wait))
(log-info "finder ready.")

(unless (housekeeping-initialized?)
  (log-info "waiting for housekeeping.")
  (housekeeping-wait))
(log-info "housekeeping ready.")

(unless (and (instrument-initialized?) (instrument-idle?))
  (log-info "waiting for instrument.")
  (instrument-wait))
(log-info "instrument ready.")

(log-info "")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(log-info "configuring finder.")
(log-info "")

(finder-set-scale! 43.0)

(finder-set-window-center! 640 512)
(finder-configure! 'full-frame-1)

(finder-set-search-radius!     50)
(finder-set-refinement-radius! 20)

(finder-set-r-vector!
 (let ((file-path "/usr/local/oaxaca/var/finder/r-vector"))
   (if (file-exists? file-path)
     (call-with-input-file file-path read)
     #(640 512))))

(log-info "finished configuring finder.")
(log-info "")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(log-info "configuring instrument.")
(log-info "")

(instrument-set-scale! 0.614)

(instrument-set-window-center! 640 512)
(instrument-configure! 'full-frame-1)

(instrument-set-search-radius!     50)
(instrument-set-refinement-radius! 20)

(instrument-set-r-vector!
 (let ((file-path "/usr/local/oaxaca/var/instrument/r-vector"))
   (if (file-exists? file-path)
     (call-with-input-file file-path read)
     #(640 512))))
(log-info (instrument-r-vector))

(log-info "finished configuring instrument.")
(log-info "")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
